#ifndef __VTOR_SNAKE_H__
#define __VTOR_SNAKE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "vtor_map.h"

#ifdef __VTOR_SNAKE__


typedef enum{
	VtorSnake_NULL = 0,
	VtorSnake_SNAKE,
	VtorSnake_FOOD,
	VtorSnake_WALL,
}VtorSnakeEnum;

typedef struct{
	int16_t x;
	int16_t y;
}VtorSnakePoint;

typedef struct{

	int16_t headIdx;		//蛇头下标
	int16_t len;			//蛇长度（包括头，建议为3）
	int16_t maxLen;
	VtorSnakePoint spd;
	
	VtorSnakePoint body[128];
	VtorSnakePoint food[1];

	VtorMap* map;
}VtorSnake;


void VtorSnake_CreateFood(VtorSnake* snake);
void VtorSnake_SetSpeed(VtorSnake* snake, int8_t x, int8_t y);
void VtorSnake_Move(VtorSnake* snake);
void VtorSnake_Draw(VtorSnake* snake);
int8_t VtorSnake_CheckHead(VtorSnake* snake);
void VtorSnake_Play(VtorSnake* snake);
void VtorSnake_Init(void);

#endif // __VTOR_SNAKE__

#ifdef __cplusplus
}
#endif
#endif
